<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

Route::prefix('admin')->group(function(){
    Route::get('/login', [\App\Http\Controllers\Auth\AdminLoginController::class, 'showLoginForm']);
    Route::post('/login', [\App\Http\Controllers\Auth\AdminLoginController::class, 'login'])->name('backend.login');
    Route::get('/', [\App\Http\Controllers\AdminController::class, 'index'])->name('admin.home');
});
